
#include <asm.h>

.global C_SYMBOL(SetColor_8u_C4A)

C_SYMBOL(SetColor_8u_C4A):

    STMFD	SP!, {R4-R8,LR}
    MOV	LR, R0
    LDR	R1, [LR, #0x4]                 //pDst
	LDR	R2, [LR, #0xC]                 //DstStep

    LDR	R3, [LR, #0x10]                 //width
    LDR	R4, [LR, #0x14]                 //height
    MOV R3, R3, LSL #2
	LDR	R8, [LR, #0x18]                 //color

    SUB	R2, R2,	R3

    TMCRR   wR0, R8, R8


_lc010_000413_:
    MOV	R5, R3
    ADD	R6, R1,	#7
    BIC	R6, R6,	#7
    SUB	R6, R6,	R1
    CMP	R6, #0
    BEQ	_lc030_000440_

_lc020_000428_:
    CMP	R6, R5
    MOVGT	R6, R5
    SUB	R5, R5,	R6

_lc021_000432_:
    SUBS	R6, R6,	#4
    WSTRW   wR0, [R1], #4
    BGT	_lc021_000432_
    CMP	R5, #0
    BEQ	_lc060_000464_

_lc030_000440_:
    SUBS	R5, R5,	#0x20
    ADDMI	R6, R5,	#0x20
    ADDMI	R5, R5,	#0x20
    BMI	_lc020_000428_

_lc040_000449_:
    WSTRD   wR0, [R1], #8
    WSTRD   wR0, [R1], #8
    SUBS	R5, R5,	#0x20
    WSTRD   wR0, [R1], #8
    WSTRD   wR0, [R1], #8
    BGE	_lc040_000449_
    ADDS	R5, R5,	#0x20
    MOVGT	R6, R5
    BGT	_lc020_000428_

_lc060_000464_:
    ADD	R1, R1,	R2
    SUBS	R4, R4,	#1
    BGT	_lc010_000413_
    LDMFD	SP!, {R4-R8,PC}







